package cn.appsys.service.developer;

import cn.appsys.dao.datadictionary.DataDictionaryMapper;
import cn.appsys.pojo.DataDictionary;
import cn.appsys.tools.PageSupport;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DataDictionaryServiceImpl implements DataDictionaryService {

    @Resource
    private DataDictionaryMapper mapper;

    @Override
    public List<DataDictionary> getDataDictionaryList(String typeCode)
            throws Exception {
        return mapper.getDataDictionaryList(typeCode);
    }

    @Override
    public List<DataDictionary> getList(DataDictionary dataDictionary, PageSupport pageSupport) throws Exception {
        return mapper.getList(dataDictionary, (pageSupport.getCurrentPageNo() - 1) * pageSupport.getPageSize(), pageSupport.getPageSize());
    }

    @Override
    public int getCount(DataDictionary dataDictionary) throws Exception {
        return mapper.getCount(dataDictionary);
    }

    @Override
    public List<DataDictionary> getGroupTypeService() throws Exception {
        return mapper.getGroupType();
    }

}
